<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>车票订单查询</title>
    <link rel="stylesheet" href="../CSS/common.css">
    <link rel="stylesheet" href="../CSS/order.css">
</head>
<body>
<div id="navBar">
    <div><a href="/index">首页</a></div>
    <div><a href="/order">订单</a></div>
    <div><a href="/mine">我的</a></div>
</div>
<div class="container">
    <h1>我的订单查询</h1>
    <div class="search-bar">
        <input type="text" id="searchInput" placeholder="输入订单号或城市查询">
        <button onclick="searchOrders()">查询</button>
    </div>
    <ul class="order-list" id="orderList">
        <c:if test="${empty orders}">
            <li>目前没有订单</li>
        </c:if>
        <c:if test="${not empty orders}">
            <c:forEach var="order" items="${orders}">
                <li class="order-item">
                    <div class="order-header">
                        <span class="order-id">车号：${order['lineName']}</span>
                    </div>
                    <div class="order-details">
                        <p><strong>用户名：</strong>${order['name']}</p>
                        <p><strong>价钱：</strong>${order['price']}</p>
                        <p><strong>座位等级：</strong>${order['levelName']}</p>
                        <p><strong>途径站点：</strong>${order['passby']}</p>
                        <p><strong>站点数：</strong>${order['siteNum']}</p>
                    </div>
                </li>
            </c:forEach>
        </c:if>
    </ul>
    <div class="footer">
        <p>共展示 <span id="orderCount">0</span> 个订单。</p>
    </div>
</div>
<%--<script src="../JS/order.js"></script>--%>
</body>
</html>



